package poker;

public class Card
{   
	//figury
    private static String[] ranks  = {"2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"};
	//kolory
    private static String[] suits = {"spades", "hearts", "clubs", "diamonds"};
	private short rank, suit;

    Card(short suit, short rank) throws PokerException
    {
    	if(((suit>=0)&&(suit<4))&&((rank>=0)&&(rank<13)))
    	{
    		this.rank=rank;
    		this.suit=suit;
    	}
    	else throw new PokerException("This card does not exist!");
    }

    public short getRank()
	{
         return rank;
    }

    public short getSuit()
	{
        return suit;
    }
	
	public static String rankAsString(int rank)
	{
        return ranks[rank];
    }
	
    public String toString()
    {
		return ranks[rank] + " of " + suits[suit];
    }
}